#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

struct stu
{
public:
    string name;  // 名字
    string skill; // 技能
    int id;       // 学号

public:
    stu() {}

    stu(string name, string skill, int id) : name(name), skill(skill), id(id) {}
};

bool Func(stu val)
{
    if (val.id == 4)
    {
        return 1;
    }
    return 0;
}


int main(int argc, char const *argv[])
{
    // 创建容器
    vector<stu> s1;
    s1.push_back(stu("唐三" , "复活吧,我的爱人" , 1));
    s1.push_back(stu("萧炎", "佛怒火莲", 2));
    s1.push_back(stu("林动", "大荒囚天指", 3));
    s1.push_back(stu("牧尘", "灵阵,起!!!", 4));
    s1.push_back(stu("陈平安", "妈来!!!", 5));

    // 查找 id = 10的

    vector<stu>::iterator it = find_if(s1.begin() , s1.end() , Func);

    cout << it->name << endl;
    return 0;
}
